package com.cn.easy.export.model.excel

import com.cn.easy.export.model.enumerate.ExcelImageType

data class ExcelImage(
    val bytes: ByteArray,
    val type: ExcelImageType,
    val width: Int = 150,
    val height: Int = 150
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as ExcelImage

        if (width != other.width) return false
        if (height != other.height) return false
        if (!bytes.contentEquals(other.bytes)) return false
        if (type != other.type) return false

        return true
    }

    override fun hashCode(): Int {
        var result = width
        result = 31 * result + height
        result = 31 * result + bytes.contentHashCode()
        result = 31 * result + type.hashCode()
        return result
    }
}
